package com.wowudi.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wowudi.entity.Patients;
import com.wowudi.entity.TreatResult;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface TreatResultMapper extends BaseMapper<TreatResult> {
    @Select("select * from treat_result tr,patients pt,department_class dpc,sys_user su where tr.pt_id=pt.pt_id and tr.dpc_id=dpc.dpc_id and tr.w_id=su.user_id and tr_isdel=0 and(pt.pt_card =#{cartid}  or pt.pt_name like CONCAT(CONCAT('%',#{patiname}),'%'))")
    @ResultMap("BaseResultMap")
    Page<TreatResult> getAllBynameandid(@Param("page")Page<TreatResult> page, @Param("cartid")String cartid, @Param("patiname")String patiname);
}